Many software applications and computing systems at some time display numbers, on a display screen, in printed reports, on web pages, or elsewhere. Many programs use floating-point numbers which are converted from their native binary format into a human-readable decimal format. Such applications run on desktop computers, laptops, mainframes, and servers, for example.
Environments for writing software in many programming languages provide developers with functions to format binary representations of numeric values into one or more corresponding decimal representations, and with printf-style formatting functions. As used herein, “printf-style functions” include functions or other programming language statements which accept as input a format control string and zero or more other parameters, and produce an output string which is formatted according to the format control string and which includes values obtained from other parameters when other parameters are present. Sometimes formatting is implicit in the choice of printf-style function used, e.g., a WriteLine( ) or println( ) function would be expected to include a newline at the end of the output string even without an explicit newline in the format control string.
Many printf-style functions accept a variable number of parameters (i.e., different invocations of the function may pass a different number of parameters), while other printf-style functions expect a fixed number of parameters. Most printf-style functions of interest herein either accept a variable number of parameters, or accept a fixed number of parameters which however include at least one parameter in addition to a format control string. Parameters may be “passed” to a printf-style function via a call stack, one or more global variables, one or more registers, or another data transfer mechanism.
Some examples of printf-style functions include printf( ) itself, C-based language variations such as sprintf( ) and fprint( ), FORTRAN's FORMAT-statement-controlled PRINT statement, and a great many others. Printf-style functions are often, but not always, named using some variation of a term such as “display”, “echo”, “message”, “out”, “print”, “put”, or “write”, for example. Some printf-style functions use ‘%’ to refer 945 to parameter positions in a format control string, e.g., “printf(“Max=% d Min=% d”, max, min);” and some use curly braces, e.g., “String.Format(“Max={0} Min={1}”, max, min);” as references 945. Others may use different syntax.